/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package motiveai.tests;

import motiveai.annotation.DurationOfBehaviour;
import motiveai.components.BehaviourEntity;
import motiveai.factors.Environment;

/**
 *
 * @author oxplay
 */
public class Test4Idle extends BehaviourEntity<Test4Agent> {

    public Test4Idle(){
    }
    
    public boolean canBeUsed(Test4Agent agent, Environment environment) {
        if (environment.getIntegerFactor("closeEnemyType") > 0) {
            return false;
        }
        return true;
    }

    @Override
    @DurationOfBehaviour(duration=0.5f)
    public float behave(Test4Agent agent, Environment environment) {
        agent.actualBehaviour = "idling!";
        environment.setBooleanFactor("isRested", true);
        //environment.setBooleanFactor("isAttacking", false);
        return 0;
    }

}
